package com.zh.remote.api;

import com.zh.constants.Constants;
import com.zh.remote.fallback.LoginApiFallback;
import com.zh.remote.pojo.param.CreateLoginDto;
import com.zh.remote.pojo.param.UpdateLoginDto;
import com.zh.result.JSONResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

/**
 * 远程保存Login对象
 */
@FeignClient(value = Constants.Remote.SERVICE_UAA,fallbackFactory = LoginApiFallback.class )
@Tag(name = "登录表",description = "登录表")
public interface LoginApi {

    @Operation( summary= "远程保存Login",description = "基础对象保存接口")
    @Parameter(name = "createLogin",description = "保存的对象",required = true)
    @PostMapping("remote/create/login")
    JSONResult createLogin(@RequestBody @Valid CreateLoginDto createLogin );
    @Operation( summary= "远程修改Login",description = "基础对象修改接口")
    @Parameter(name = "createLogin",description = "修改的对象",required = true)
    @PostMapping("remote/update/login")
    JSONResult updateLogin(@RequestBody @Valid UpdateLoginDto updateLogin);
}


